<extend name="Public/base"/>

<block name="style">
  <link rel="stylesheet" type="text/css" href="__CSS__/order.css" media="all">
</block>

<block name="body">
  <!-- 标题 -->
  <div class="main-title">
    <h2>
      
      团购订单列表({$_total})
    </h2>
  </div>
  <!-- 按钮工具栏 -->
  <div class="cf">
  </div>
  <!-- 数据表格 -->
  <table class="order-table-head">
    <tr>
      <th width="30">
      </th>
      <th width="650">订单基本信息</th>
      <th  class="text-center">开团要求</th>

      <th width="53">参团人数</th>
      <th width="93">状态</th>
      <th width="153">操作</th>
    </tr>
  </table>
  <notempty name="list">
    <volist name="list" key='key' id="vo">
      <table class="order-table">
        <tr>
          <th colspan="8">
            <span class="text-cancel">下单时间：</span>
            {$vo.stime|time_format}
            <span class="split-tab"></span>
            <span class="text-cancel">发起人：</span>
            <a href="{:U('User/view?id='.$vo['reg_uid'])}">{$vo.reg_uid|get_nickname}</a>
            <span class="split-tab"></span>
          </th>
        </tr>
        <tr>
          <td width="20" >
          </td>
          <td width="130" class="item-lists">
              <a href="{:U('/Join/detail?id='.$vo['item_id'])}" target="_blank"><img src="{:get_image_thumb(get_cover(get_item_images($vo['item_id']), 'path'), 60, 60)}" title="{$vo['item_id']|get_item_name}"></a>
          </td>
          <td width="190">商品编号：{$vo.number}</td>
          <td width="300" class="text-right">
          <a href="{:U('/Join/detail?id='.$vo['item_id'])}" target="_blank">
          {$vo.name}</td>
          </a>
          <td class="text-center">
            开团要求：<span class="split-tab">{$vo.num}人以上</span>
          </td>
          <td width="53" class="text-center">
            {$vo.id|join_count}
          </td>
          <td width="93" class="text-center">
            <switch name='vo.status'>
              <case value='0'>待拼团</case>
              <case value='1'>拼团成功</case>
              <case value='2'>拼单失败,退款处理中</case>
              <case value='3'>拼团失败且已退款</case>
            </switch>
          </td>
          <td width="140" class="text-center">
             <a href="{:U('view?id='.$vo['id'])}">[查看详情]</a>
            </td>
          </td>
        </tr>

      </table>
    </volist>
    <div class="page">
      {$_page}
    </div>
  <else/>
  <div class="list-empty">
    暂无订单！
  </div>
  </notempty>
</block>

<block name="script">
  <script src="__PUBLIC__/Admin/js/My97Date/WdatePicker.js"></script>
  <script type="text/javascript">
    $(function(){
      //设置单选，复选，下拉菜单的值
      Core.setValue('is_sdp', '{:I("get.is_sdp")}');
      Core.setValue('o_status', '{$o_status|default = ""}');
      Core.setValue('time_type', '{$time_type|default = ""}');
      //时间选择
      $('.date_select').focus(function(){
        WdatePicker({skin: 'twoer', dateFmt: 'yyyy-MM-dd', maxDate: '%y-%M-%d'});
      });
      //导航高亮
      highlight_subnav("{:U('orderList')}");
    });
  </script>
</block>